#include "qdialog6.h"
#include <string>

extern int cal_form;
int _row4, _row5;
double _times_2;
int _times_2f_nume, _times_2f_demo = 1;

qdialog6::qdialog6(QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);
	connect(this, &qdialog6::accepted, [=]() {
		_row4 = ui.row_6->text().toInt() - 1;
		_row5 = ui.row_7->text().toInt() - 1;
        if (cal_form == 0) {
            _times_2 = ui.times_2->text().toDouble();
        }
        else if (cal_form == 1) {
            QString str = ui.times_2->text();
            std::string s = str.toStdString();

            if (s.find("/") != -1) {
                _times_2f_nume = str.left(str.indexOf("/")).toInt();
                _times_2f_demo = str.mid(str.indexOf("/") + 1).toInt();
            }
            else {
                _times_2f_nume = str.toInt();
            }
        }
		_times_2 = ui.times_2->text().toDouble();
		});
}

qdialog6::~qdialog6()
{
}